/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.upc.dew.sisrest.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import pe.edu.upc.dew.sisrest.model.Plato;
import pe.edu.upc.dew.sisrest.service.PlatoManager;

/**
 *
 * @author Aldo
 */

@Controller
public class PlatoController {

    PlatoManager platoManager;

    @Autowired
    public PlatoController(PlatoManager oPlatoManager){
        this.platoManager=oPlatoManager;
    }

    @RequestMapping("/adm_platos.htm")
    public void adm_platos(Model model, @ModelAttribute("Plato") Plato plato) {
		List<Plato> platos = platoManager.obtenerListaPlatos();
                model.addAttribute("platos", platos);
                model.addAttribute("plato", plato);
    }
}